package com.css.fxfzypg.modules.saresults.controller;

import com.css.fxfzypg.base.response.RestResponse;
import com.css.fxfzypg.modules.saresults.entity.DzqhQpBasicMapEntity;
import com.css.fxfzypg.modules.saresults.param.DrillHoleQueryParam;
import com.css.fxfzypg.modules.saresults.service.KzsfResultsService;
import com.css.fxfzypg.modules.saresults.vo.SaResultsHlVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * 抗震设防数据管理
 */
@RestController
@RequestMapping("kzsfResults")
public class KzsfResultsController {

    @Autowired
    private KzsfResultsService kzsfResultsService;

    /**
     * 抗震设防项目信息分页查询
     *
     * @param
     * @return
     */
    @GetMapping("getKzsfResultsProject")
    public RestResponse getKzsfResultsProject(DzqhQpBasicMapEntity qpBasicMapEntity, HttpServletRequest request,String geom) {
        return kzsfResultsService.getKzsfResultsProject(qpBasicMapEntity, request,geom);
    }

    /**
     * 抗震设防孔位信息分页查询
     *
     * @return
     */
    @GetMapping("getKzsfResultsHl")
    public RestResponse getKzsfResultsHl(DrillHoleQueryParam param, HttpServletRequest request, String geom) {
        return kzsfResultsService.getKzsfResultsHl(param, request,geom);
    }

    /**
     * 修改回显
     *
     * @param projectId
     * @return
     */
    @GetMapping("getKzsfResultsById")
    public RestResponse getKzsfResultsById(String projectId, String modelName) {
        return kzsfResultsService.getKzsfResultsById(projectId, modelName);
    }

    /**
     * 数据导出
     *
     * @return
     */
    @GetMapping("exportExcelKzsfResults")
    public void exportExcelKzsfResults(HttpServletResponse response, String projectId, String modelName) {
        kzsfResultsService.exportExcelKzsfResults(response, projectId, modelName);
    }

    /**
     * 钻孔数据导出
     */
    @PostMapping("exportExcel")
    public void exportExcel(HttpServletResponse response,DrillHoleQueryParam param) {
        kzsfResultsService.exportExcel(response,param);
    }
}
